package com.zhang.gateway.common.model.exception;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 深圳金雅福控股集团有限公司
 *
 * @author zhangfanjun
 * @date 2021/11/17
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class KingHoodException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Integer code;

    public KingHoodException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public static KingHoodException getInstance(Integer code, String message) {
        return new KingHoodException(code, message);
    }

    public static KingHoodException getInstance(String message) {
        return new KingHoodException(500, message);
    }
}
